from flask import Blueprint
import json
from app.auth.common import authCommon
auth_bp=Blueprint('user',__name__,url_prefix='/' + authCommon().auth)
from app.services.reques_http import RequestHandler

@auth_bp.route('/' + authCommon().login)
def index():
    print(authCommon().login)
     # 以下是测试代码
    # get请求接口
#     url = 'https://api.apiopen.top/getJoke?page=1&count=2&type=video'
#     res = RequestHandler().get(url)
    # post请求接口
    # url2 = 'http://127.0.0.1:8000/user/login/'
    # payload = {
    #     "username": "vivi",
    #     "password": "123456"
    # }
    # res2 = RequestHandler().post(url2,json=payload)
#     print("11",  res.json() )
    # print(res2.json())
    return "success"

@auth_bp.route(authCommon().central_peoples_government)
def getJoke():
     # 以下是测试代码
    # get请求接口
#     url = 'https://api.apiopen.top/getJoke?page=1&count=2&type=video'
#     res = RequestHandler().get(url)
    # post请求接口
    # url2 = 'http://127.0.0.1:8000/user/login/'
    # payload = {
    #     "username": "vivi",
    #     "password": "123456"
    # }
    # res2 = RequestHandler().post(url2,json=payload)
#     print("11",  res.json() )
    # print(res2.json())
    return "error"
